Skip to content

fix: keep transitive scanning with --offline-vulnerabilities#2783

Open
gotgolem wants to merge 2 commits into
google:mainfrom
gotgolem:fix/offline-vulnerabilities-transitive
Open

fix: keep transitive scanning with --offline-vulnerabilities#2783
gotgolem wants to merge 2 commits into
google:mainfrom
gotgolem:fix/offline-vulnerabilities-transitive

Conversation

@gotgolem
Copy link
Copy Markdown

@gotgolem gotgolem commented May 7, 2026

Overview

Fixes #2775.

--offline-vulnerabilities is documented as only switching vulnerability matching to the local DB, but it was also causing Scalibr to filter out network-backed plugins.
That meant transitive dependency scanning was disabled even when --no-resolve was not passed.

This PR keeps that behavior scoped to the full --offline flag instead.

Details

I added a separate ScannerActions.PluginNetworkDisabled field and wire it from --offline.

CompareOffline still controls the local vulnerability DB path. The source and container scan paths now use PluginNetworkDisabled when setting Scalibr's network capability.

License behavior under --offline-vulnerabilities is intentionally left unchanged in this PR.

Testing

  • go test ./pkg/osvscanner ./cmd/osv-scanner/internal/helper
  • go test ./cmd/osv-scanner/scan/source -run TestCommand_Transitive -count=1

Also ran:

  • ./scripts/run_tests.sh
    • Fails locally on unrelated snapshot drift from external data changes.

Checklist

@gotgolem gotgolem force-pushed the fix/offline-vulnerabilities-transitive branch 3 times, most recently from ee57ce6 to d407f3d Compare May 8, 2026 04:56
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.81%. Comparing base (408fcd6) to head (d407f3d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2783      +/-   ##
==========================================
- Coverage   79.19%   78.81%   -0.38%     
==========================================
  Files         121      121              
  Lines        8185     8186       +1     
==========================================
- Hits         6482     6452      -30     
- Misses       1322     1347      +25     
- Partials      381      387       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gotgolem gotgolem force-pushed the fix/offline-vulnerabilities-transitive branch from d407f3d to 401332d Compare May 17, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--offline-vulnerabilities also disables transitive scanning

2 participants